/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - GetPublicObservationsResponseList_type.as.
 */

package valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.util.FiberUtils;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.binding.utils.ChangeWatcher;
import mx.collections.ArrayCollection;
import mx.events.PropertyChangeEvent;
import mx.validators.ValidationResult;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[ExcludeClass]
public class _Super_GetPublicObservationsResponseList_type extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
    }

    model_internal var _dminternal_model : _GetPublicObservationsResponseList_typeEntityMetadata;
    model_internal var _changedObjects:mx.collections.ArrayCollection = new ArrayCollection();

    public function getChangedObjects() : Array
    {
        _changedObjects.addItemAt(this,0);
        return _changedObjects.source;
    }

    public function clearChangedObjects() : void
    {
        _changedObjects.removeAll();
    }

    /**
     * properties
     */
    private var _internal_record_id : int;
    private var _internal_station_id : int;
    private var _internal_observation_date : String;
    private var _internal_individual_id : int;
    private var _internal_scientific_name : String;
    private var _internal_common_name : String;
    private var _internal_kingdom : String;
    private var _internal_category : String;
    private var _internal_phenophase_name : String;
    private var _internal_definition : String;
    private var _internal_additional_definition : String;
    private var _internal_search_method : String;
    private var _internal_duration : int;
    private var _internal_duration_units : String;
    private var _internal_extent : String;
    private var _internal_latitude : Number;
    private var _internal_longitude : Number;
    private var _internal_elevation : int;
    private var _internal_network_name : String;

    private static var emptyArray:Array = new Array();

    // Change this value according to your application's floating-point precision
    private static var epsilon:Number = 0.0001;

    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_GetPublicObservationsResponseList_type()
    {
        _model = new _GetPublicObservationsResponseList_typeEntityMetadata(this);

        // Bind to own data or source properties for cache invalidation triggering
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "observation_date", model_internal::setterListenerObservation_date));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "scientific_name", model_internal::setterListenerScientific_name));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "common_name", model_internal::setterListenerCommon_name));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "kingdom", model_internal::setterListenerKingdom));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "category", model_internal::setterListenerCategory));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "phenophase_name", model_internal::setterListenerPhenophase_name));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "definition", model_internal::setterListenerDefinition));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "additional_definition", model_internal::setterListenerAdditional_definition));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "search_method", model_internal::setterListenerSearch_method));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "duration_units", model_internal::setterListenerDuration_units));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "extent", model_internal::setterListenerExtent));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "network_name", model_internal::setterListenerNetwork_name));

    }

    /**
     * data/source property getters
     */

    [Bindable(event="propertyChange")]
    public function get record_id() : int
    {
        return _internal_record_id;
    }

    [Bindable(event="propertyChange")]
    public function get station_id() : int
    {
        return _internal_station_id;
    }

    [Bindable(event="propertyChange")]
    public function get observation_date() : String
    {
        return _internal_observation_date;
    }

    [Bindable(event="propertyChange")]
    public function get individual_id() : int
    {
        return _internal_individual_id;
    }

    [Bindable(event="propertyChange")]
    public function get scientific_name() : String
    {
        return _internal_scientific_name;
    }

    [Bindable(event="propertyChange")]
    public function get common_name() : String
    {
        return _internal_common_name;
    }

    [Bindable(event="propertyChange")]
    public function get kingdom() : String
    {
        return _internal_kingdom;
    }

    [Bindable(event="propertyChange")]
    public function get category() : String
    {
        return _internal_category;
    }

    [Bindable(event="propertyChange")]
    public function get phenophase_name() : String
    {
        return _internal_phenophase_name;
    }

    [Bindable(event="propertyChange")]
    public function get definition() : String
    {
        return _internal_definition;
    }

    [Bindable(event="propertyChange")]
    public function get additional_definition() : String
    {
        return _internal_additional_definition;
    }

    [Bindable(event="propertyChange")]
    public function get search_method() : String
    {
        return _internal_search_method;
    }

    [Bindable(event="propertyChange")]
    public function get duration() : int
    {
        return _internal_duration;
    }

    [Bindable(event="propertyChange")]
    public function get duration_units() : String
    {
        return _internal_duration_units;
    }

    [Bindable(event="propertyChange")]
    public function get extent() : String
    {
        return _internal_extent;
    }

    [Bindable(event="propertyChange")]
    public function get latitude() : Number
    {
        return _internal_latitude;
    }

    [Bindable(event="propertyChange")]
    public function get longitude() : Number
    {
        return _internal_longitude;
    }

    [Bindable(event="propertyChange")]
    public function get elevation() : int
    {
        return _internal_elevation;
    }

    [Bindable(event="propertyChange")]
    public function get network_name() : String
    {
        return _internal_network_name;
    }

    public function clearAssociations() : void
    {
    }

    /**
     * data/source property setters
     */

    public function set record_id(value:int) : void
    {
        var oldValue:int = _internal_record_id;
        if (oldValue !== value)
        {
            _internal_record_id = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "record_id", oldValue, _internal_record_id));
        }
    }

    public function set station_id(value:int) : void
    {
        var oldValue:int = _internal_station_id;
        if (oldValue !== value)
        {
            _internal_station_id = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "station_id", oldValue, _internal_station_id));
        }
    }

    public function set observation_date(value:String) : void
    {
        var oldValue:String = _internal_observation_date;
        if (oldValue !== value)
        {
            _internal_observation_date = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "observation_date", oldValue, _internal_observation_date));
        }
    }

    public function set individual_id(value:int) : void
    {
        var oldValue:int = _internal_individual_id;
        if (oldValue !== value)
        {
            _internal_individual_id = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "individual_id", oldValue, _internal_individual_id));
        }
    }

    public function set scientific_name(value:String) : void
    {
        var oldValue:String = _internal_scientific_name;
        if (oldValue !== value)
        {
            _internal_scientific_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "scientific_name", oldValue, _internal_scientific_name));
        }
    }

    public function set common_name(value:String) : void
    {
        var oldValue:String = _internal_common_name;
        if (oldValue !== value)
        {
            _internal_common_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "common_name", oldValue, _internal_common_name));
        }
    }

    public function set kingdom(value:String) : void
    {
        var oldValue:String = _internal_kingdom;
        if (oldValue !== value)
        {
            _internal_kingdom = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "kingdom", oldValue, _internal_kingdom));
        }
    }

    public function set category(value:String) : void
    {
        var oldValue:String = _internal_category;
        if (oldValue !== value)
        {
            _internal_category = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "category", oldValue, _internal_category));
        }
    }

    public function set phenophase_name(value:String) : void
    {
        var oldValue:String = _internal_phenophase_name;
        if (oldValue !== value)
        {
            _internal_phenophase_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophase_name", oldValue, _internal_phenophase_name));
        }
    }

    public function set definition(value:String) : void
    {
        var oldValue:String = _internal_definition;
        if (oldValue !== value)
        {
            _internal_definition = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "definition", oldValue, _internal_definition));
        }
    }

    public function set additional_definition(value:String) : void
    {
        var oldValue:String = _internal_additional_definition;
        if (oldValue !== value)
        {
            _internal_additional_definition = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "additional_definition", oldValue, _internal_additional_definition));
        }
    }

    public function set search_method(value:String) : void
    {
        var oldValue:String = _internal_search_method;
        if (oldValue !== value)
        {
            _internal_search_method = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "search_method", oldValue, _internal_search_method));
        }
    }

    public function set duration(value:int) : void
    {
        var oldValue:int = _internal_duration;
        if (oldValue !== value)
        {
            _internal_duration = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "duration", oldValue, _internal_duration));
        }
    }

    public function set duration_units(value:String) : void
    {
        var oldValue:String = _internal_duration_units;
        if (oldValue !== value)
        {
            _internal_duration_units = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "duration_units", oldValue, _internal_duration_units));
        }
    }

    public function set extent(value:String) : void
    {
        var oldValue:String = _internal_extent;
        if (oldValue !== value)
        {
            _internal_extent = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "extent", oldValue, _internal_extent));
        }
    }

    public function set latitude(value:Number) : void
    {
        var oldValue:Number = _internal_latitude;
        if (isNaN(_internal_latitude) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_latitude = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "latitude", oldValue, _internal_latitude));
        }
    }

    public function set longitude(value:Number) : void
    {
        var oldValue:Number = _internal_longitude;
        if (isNaN(_internal_longitude) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_longitude = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "longitude", oldValue, _internal_longitude));
        }
    }

    public function set elevation(value:int) : void
    {
        var oldValue:int = _internal_elevation;
        if (oldValue !== value)
        {
            _internal_elevation = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "elevation", oldValue, _internal_elevation));
        }
    }

    public function set network_name(value:String) : void
    {
        var oldValue:String = _internal_network_name;
        if (oldValue !== value)
        {
            _internal_network_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "network_name", oldValue, _internal_network_name));
        }
    }

    /**
     * Data/source property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */

    model_internal function setterListenerObservation_date(value:flash.events.Event):void
    {
        _model.invalidateDependentOnObservation_date();
    }

    model_internal function setterListenerScientific_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnScientific_name();
    }

    model_internal function setterListenerCommon_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCommon_name();
    }

    model_internal function setterListenerKingdom(value:flash.events.Event):void
    {
        _model.invalidateDependentOnKingdom();
    }

    model_internal function setterListenerCategory(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCategory();
    }

    model_internal function setterListenerPhenophase_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPhenophase_name();
    }

    model_internal function setterListenerDefinition(value:flash.events.Event):void
    {
        _model.invalidateDependentOnDefinition();
    }

    model_internal function setterListenerAdditional_definition(value:flash.events.Event):void
    {
        _model.invalidateDependentOnAdditional_definition();
    }

    model_internal function setterListenerSearch_method(value:flash.events.Event):void
    {
        _model.invalidateDependentOnSearch_method();
    }

    model_internal function setterListenerDuration_units(value:flash.events.Event):void
    {
        _model.invalidateDependentOnDuration_units();
    }

    model_internal function setterListenerExtent(value:flash.events.Event):void
    {
        _model.invalidateDependentOnExtent();
    }

    model_internal function setterListenerNetwork_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnNetwork_name();
    }


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;
        if (!_model.observation_dateIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_observation_dateValidationFailureMessages);
        }
        if (!_model.scientific_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_scientific_nameValidationFailureMessages);
        }
        if (!_model.common_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_common_nameValidationFailureMessages);
        }
        if (!_model.kingdomIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_kingdomValidationFailureMessages);
        }
        if (!_model.categoryIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_categoryValidationFailureMessages);
        }
        if (!_model.phenophase_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_phenophase_nameValidationFailureMessages);
        }
        if (!_model.definitionIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_definitionValidationFailureMessages);
        }
        if (!_model.additional_definitionIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_additional_definitionValidationFailureMessages);
        }
        if (!_model.search_methodIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_search_methodValidationFailureMessages);
        }
        if (!_model.duration_unitsIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_duration_unitsValidationFailureMessages);
        }
        if (!_model.extentIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_extentValidationFailureMessages);
        }
        if (!_model.network_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_network_nameValidationFailureMessages);
        }

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _GetPublicObservationsResponseList_typeEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _GetPublicObservationsResponseList_typeEntityMetadata) : void
    {
        var oldValue : _GetPublicObservationsResponseList_typeEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }

    model_internal var _doValidationCacheOfObservation_date : Array = null;
    model_internal var _doValidationLastValOfObservation_date : String;

    model_internal function _doValidationForObservation_date(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfObservation_date != null && model_internal::_doValidationLastValOfObservation_date == value)
           return model_internal::_doValidationCacheOfObservation_date ;

        _model.model_internal::_observation_dateIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isObservation_dateAvailable && _internal_observation_date == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "observation_date is required"));
        }

        model_internal::_doValidationCacheOfObservation_date = validationFailures;
        model_internal::_doValidationLastValOfObservation_date = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfScientific_name : Array = null;
    model_internal var _doValidationLastValOfScientific_name : String;

    model_internal function _doValidationForScientific_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfScientific_name != null && model_internal::_doValidationLastValOfScientific_name == value)
           return model_internal::_doValidationCacheOfScientific_name ;

        _model.model_internal::_scientific_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isScientific_nameAvailable && _internal_scientific_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "scientific_name is required"));
        }

        model_internal::_doValidationCacheOfScientific_name = validationFailures;
        model_internal::_doValidationLastValOfScientific_name = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCommon_name : Array = null;
    model_internal var _doValidationLastValOfCommon_name : String;

    model_internal function _doValidationForCommon_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCommon_name != null && model_internal::_doValidationLastValOfCommon_name == value)
           return model_internal::_doValidationCacheOfCommon_name ;

        _model.model_internal::_common_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCommon_nameAvailable && _internal_common_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "common_name is required"));
        }

        model_internal::_doValidationCacheOfCommon_name = validationFailures;
        model_internal::_doValidationLastValOfCommon_name = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfKingdom : Array = null;
    model_internal var _doValidationLastValOfKingdom : String;

    model_internal function _doValidationForKingdom(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfKingdom != null && model_internal::_doValidationLastValOfKingdom == value)
           return model_internal::_doValidationCacheOfKingdom ;

        _model.model_internal::_kingdomIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isKingdomAvailable && _internal_kingdom == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "kingdom is required"));
        }

        model_internal::_doValidationCacheOfKingdom = validationFailures;
        model_internal::_doValidationLastValOfKingdom = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCategory : Array = null;
    model_internal var _doValidationLastValOfCategory : String;

    model_internal function _doValidationForCategory(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCategory != null && model_internal::_doValidationLastValOfCategory == value)
           return model_internal::_doValidationCacheOfCategory ;

        _model.model_internal::_categoryIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCategoryAvailable && _internal_category == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "category is required"));
        }

        model_internal::_doValidationCacheOfCategory = validationFailures;
        model_internal::_doValidationLastValOfCategory = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPhenophase_name : Array = null;
    model_internal var _doValidationLastValOfPhenophase_name : String;

    model_internal function _doValidationForPhenophase_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPhenophase_name != null && model_internal::_doValidationLastValOfPhenophase_name == value)
           return model_internal::_doValidationCacheOfPhenophase_name ;

        _model.model_internal::_phenophase_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPhenophase_nameAvailable && _internal_phenophase_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "phenophase_name is required"));
        }

        model_internal::_doValidationCacheOfPhenophase_name = validationFailures;
        model_internal::_doValidationLastValOfPhenophase_name = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfDefinition : Array = null;
    model_internal var _doValidationLastValOfDefinition : String;

    model_internal function _doValidationForDefinition(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfDefinition != null && model_internal::_doValidationLastValOfDefinition == value)
           return model_internal::_doValidationCacheOfDefinition ;

        _model.model_internal::_definitionIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isDefinitionAvailable && _internal_definition == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "definition is required"));
        }

        model_internal::_doValidationCacheOfDefinition = validationFailures;
        model_internal::_doValidationLastValOfDefinition = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfAdditional_definition : Array = null;
    model_internal var _doValidationLastValOfAdditional_definition : String;

    model_internal function _doValidationForAdditional_definition(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfAdditional_definition != null && model_internal::_doValidationLastValOfAdditional_definition == value)
           return model_internal::_doValidationCacheOfAdditional_definition ;

        _model.model_internal::_additional_definitionIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isAdditional_definitionAvailable && _internal_additional_definition == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "additional_definition is required"));
        }

        model_internal::_doValidationCacheOfAdditional_definition = validationFailures;
        model_internal::_doValidationLastValOfAdditional_definition = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfSearch_method : Array = null;
    model_internal var _doValidationLastValOfSearch_method : String;

    model_internal function _doValidationForSearch_method(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfSearch_method != null && model_internal::_doValidationLastValOfSearch_method == value)
           return model_internal::_doValidationCacheOfSearch_method ;

        _model.model_internal::_search_methodIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isSearch_methodAvailable && _internal_search_method == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "search_method is required"));
        }

        model_internal::_doValidationCacheOfSearch_method = validationFailures;
        model_internal::_doValidationLastValOfSearch_method = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfDuration_units : Array = null;
    model_internal var _doValidationLastValOfDuration_units : String;

    model_internal function _doValidationForDuration_units(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfDuration_units != null && model_internal::_doValidationLastValOfDuration_units == value)
           return model_internal::_doValidationCacheOfDuration_units ;

        _model.model_internal::_duration_unitsIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isDuration_unitsAvailable && _internal_duration_units == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "duration_units is required"));
        }

        model_internal::_doValidationCacheOfDuration_units = validationFailures;
        model_internal::_doValidationLastValOfDuration_units = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfExtent : Array = null;
    model_internal var _doValidationLastValOfExtent : String;

    model_internal function _doValidationForExtent(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfExtent != null && model_internal::_doValidationLastValOfExtent == value)
           return model_internal::_doValidationCacheOfExtent ;

        _model.model_internal::_extentIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isExtentAvailable && _internal_extent == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "extent is required"));
        }

        model_internal::_doValidationCacheOfExtent = validationFailures;
        model_internal::_doValidationLastValOfExtent = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfNetwork_name : Array = null;
    model_internal var _doValidationLastValOfNetwork_name : String;

    model_internal function _doValidationForNetwork_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfNetwork_name != null && model_internal::_doValidationLastValOfNetwork_name == value)
           return model_internal::_doValidationCacheOfNetwork_name ;

        _model.model_internal::_network_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isNetwork_nameAvailable && _internal_network_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "network_name is required"));
        }

        model_internal::_doValidationCacheOfNetwork_name = validationFailures;
        model_internal::_doValidationLastValOfNetwork_name = value;

        return validationFailures;
    }
    

}

}
